package com.hp.common.entity;

import com.hp.common.annotation.AllowedValue;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 更新用户参数
 *
 * @author <a href="mailto:xing.dong@sha.ontime-express.com">Xavier Dong</a>
 * @date
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UpdateUserParam implements Serializable {

    private static final long serialVersionUID = 273847855990613729L;

    @NotNull(message = "用户标识不能为空")
    private Long id;

    @NotBlank(message = "用户名不能为空")
    private String name;

    @NotBlank(message = "用户手机号不能为空")
    @Size(min = 8, max = 16, message = "电话号码长度介于8~16位")
    private String phone;

    @AllowedValue(value = {1,2,3,4})
    private Long address;
}